package com.zhny.meddleware;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Create By Alex On 2018/4/8 20:01
 */
@Component
public class Mediator {

    @Autowired
    private IMessenger sender;

    @Autowired
    private IMessenger receiver;

    @Autowired
    private IViewMessenger view;

    public void sendMsgToView(String message, Map<String, String> logMap) {
        view.handleMessage(message,logMap);
    }

    public void sendMsgToSender(int message){
        sender.handleMessage(message);
    }

    public void sendMsgToReceiver(int message) {
        receiver.handleMessage(message);
    }
}
